package cn.bone.web.test;

import org.springframework.util.StringUtils;

/**
 * Created by MD-01 on 2017/4/20.
 */
public class Demo {

    public BoneResponse<LoginResp> login(LoginReq loginReq){

        if(loginReq==null){
            return ResposneFactory.error("参数不能为空");
        }
        if(StringUtils.isEmpty(loginReq.getUsername())){
            return ResposneFactory.error("username不能为空");
        }
        if(StringUtils.isEmpty(loginReq.getPassword())){
            return ResposneFactory.error("password不能为空");
        }
        LoginResp resp = new LoginResp();
        resp.setUserId(1);
        resp.setUsername("戴泽");
        return ResposneFactory.ok(resp);
    }
}
